const network_utils = require('../../../../http/NetworkUtils.js');
const constants = require('../../../../common/Constants.js');
import YesterdayList from '../../../../templates/YesterdayList/YesterdayList.js'
var page = null;
var app = getApp();
let queryContent = null;
Page(Object.assign({
  data: {
    hasMore: false,
    tradingVolume: [],
  },

  onLoad: function (options) {
    if (!app.globalData.systemInfo.deviceHeight) {
      app.globalData.systemInfo.deviceHeight = wx.getSystemInfoSync().windowHeight;
    }
    let res = app.globalData.systemInfo;
    let that = this;
      page = 1;
      queryContent = options.content;
      that.setData({
        deviceW: res.windowWidth,
        deviceH: res.deviceHeight
      });
      let data = JSON.parse(options.queryData);
      that._dataFormate(data);
  },

  //加载更多
  loadMore: function () {
      this._queryRTequest();
  },

  //模糊查询分页网络请求
  _queryRTequest: function () {
    let that = this;
    let params = {
      content: queryContent,
      pageNo: page + 1 + '',
      pageSize: app.globalData.pageSize,
    };
    network_utils.buildRequest(constants.Interfaces.FUNC_Merchant_Query, params, {
      doHttpSucess: function (data) {
        if (constants.RetCodes.SUCCESS === data.retCode) {
          page++;
          that._dataFormate(data["storeList"]);
          return true;
        }

        return false;
      },

    }).send();

  },


}, YesterdayList));
